<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="pd-20">
	<div class="cl pd-5 bg-1 bk-gray"> 
	<div class="text-c"> 	
		<form class="formleft" name="" id="" action="<{:U('goods')}>" method="post">
			商品编号：
			<input class="input-text" style="width:200px" type="text" value="" placeholder="商品编号：" name="keyword" id="keyword">
			<input class="input-text" style="width:200px" type="hidden" value="<{:I('id')}>" placeholder="plan_id" name="plan_id" id="plan_id">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>	 

		</form>
		<div class="pages pageright"><{$page}></div>
	</div>
	 </div>
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="13">商品列表</th>
			</tr>
			<tr class="text-c">
				<th width="40"></th>
				<th width="40">ID</th>
				<th width="40">商品编码</th>
				<th width="40">账册编码</th>
				<th width="40">单价</th>
				<th width="40">库存数量</th>
				<th width="40">商品名称</th>
				<th width="40">商品规格</th>
				<th width="40">币制</th>
				<th width="40">第一单位</th>
				<th width="40">第二单位</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input class="uids" type="checkbox" name="ids[]" value="<{$vo.id}>"></td>
				<td><{$vo.id}></td>
				<td><{$vo.goods_no}></td>
				<td><{$vo.manual_id}></td>
				<td><{$vo.price}></td>
				<td><{$vo.storage_amount}></td>
				<td><{$vo.goods_name}></td>
				<td><{$vo.goods_spec}></td>
				<td><{$vo.coin_name}></td>
				<td><{$vo.unit1_name}></td>
				<td><{$vo.unit2_name}></td>
			</tr>
			</volist>
		</tbody>
	</table>
<button type="button" class="btn btn-success add_goods mt" style="float:left;;"><i class="icon-plus"></i> 添加</button>	
<div class="pages mt" style="text-align:right;">
<{$page}>
</div>
</div>
<script type="text/javascript">
    $(function(){
		/*保存计划入库单数据*/
        $(".add_goods").click(function(){
			var option = $(".uids");
			var checked_counts=0;
			var check_val = [];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			var goods_cate=<{:I('goods_cate')}>;
			url="<{:U('add_goods')}>";
			$.ajax({
                type: 'POST',
                data:{ids:check_val,goods_cate:goods_cate,plan_id:"<{$plan_id}>"},
                url: url,
                success:function(data){
                    layer.msg(data.info,function(){
						parent.window.location.href =parent.window.location.href;
					});
                }
            })
        });
    })
</script>

</body>
</html>